package com.hotel.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hotel.dao.RoomInfoMapper;
import com.hotel.dao.RoomStateMapper;
import com.hotel.entity.RoomInfo;
import com.hotel.entity.RoomState;
import com.hotel.service.RoomService;

@Service("roomInfoService")
@Transactional(transactionManager="txManager")
public class RoomInfoServiceImpl implements RoomService {
	
	/**
	 * 查询所有信息
	 * @return
	 */
	@Resource
	private RoomInfoMapper roomInfoMapper;
	@Resource
	private RoomStateMapper roomStateMapper;
	
	public List<RoomInfo> findRoomInfoList(Integer pageNo,Integer pageSize) {
		return roomInfoMapper.findRoomInfoList((pageNo-1)*pageSize,pageSize);
	}
	
	public List<RoomInfo> getListByStatu(Integer stateId,Integer pageNo,Integer pageSize) {
		return roomInfoMapper.getListByStatu(stateId,(pageNo-1)*pageSize,pageSize);
	}

	@Override
	public List<String> getStatus() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<RoomState> getStateList() {
		// TODO Auto-generated method stub
		return roomStateMapper.getStateList();
	}

	@Override
	public RoomInfo findByRoomId(Integer roomId) {
		return roomInfoMapper.selectByPrimaryKey(roomId);
	}

	
	
}
